package com.gw.vip.server.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gw.vip.server.po.TransLock;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDate;
import java.util.List;

/**
 * @author GW
 * @description
 * @since 2022-05-07
 */
public interface TransLockMapper extends BaseMapper<TransLock> {
    /**
     * 根据transId查找交易
     * @param transId
     * @return
     */
    @Select("SELECT * FROM trans_acc_lock WHERE trans_id=#{transId}")
    List<TransLock> listByTransId(String transId);

    /**
     * 根据id设置清算日期
     * @param clearDate
     * @param id
     */
    @Update("UPDATE trans_acc_lock SET clear_date=#{clearDate} WHERE id=#{id}")
    void setClearDateById(LocalDate clearDate, String id);
}
